DXL script that can write access settings to the database

I have a script that can read the access permissions from a DOORS database. Is there a script that can take those "read" permissions and write those to a DOORS database on another server? This would be helpful in the case where I have a test server and a production server and I want to migrate the data from the test server to the production server.
reqengineer - Fri Oct 07 11:53:00 EDT 2011

Re: DXL script that can write access settings to the database
llandale - Fri Oct 07 14:03:32 EDT 2011

Don't think you can communicate that stuff directly. You need two scripts: [1] You will need to determine your access rights, save them to some file in string format, then [2] in the other database read this file and try to apply those rights. Looks tricky to me unless the names of the projects/folders/modules etc are exactly the same.

These two functions may help:

const string    cl_sPermisNone = "None"               // none access looks like this
Buffer  gl_psnConversion_Results = create(8)    // Local buffer to the following functions.
 
//********************************
string  fStringOfAr(AccessRec ar)
{             // Get the string Permissions associated with the AccessRec;
                // e.g, 'RMCDA' or 'RM'
 
        if (null ar)  return("")
                                gl_psnConversion_Results  = ""
        if (read(ar))           gl_psnConversion_Results += "R"
        if (modify(ar))         gl_psnConversion_Results += "M"
        if (create(ar))         gl_psnConversion_Results += "C"
        if (delete(ar))         gl_psnConversion_Results += "D"
        if (control(ar))        gl_psnConversion_Results += "A"
 
        if (length(gl_psnConversion_Results) == 0) gl_psnConversion_Results = cl_sPermisNone
        return(stringOf(gl_psnConversion_Results))
}     // end fStringOfAr(ar)
 
//********************************
Permission      fPermisOf(string sPermis)
{     // Turn the string into Permission.  The string 'should' look like some combination of
        //      RMCDA
        // This function ignores any extraneous letters.
        //      e.g. if the string contains a capital 'M' anywhere then 'Modify' will be included.
 
        Permission      Permis  = none()
        if (null sPermis) return(Permis)
 
        gl_psnConversion_Results = sPermis
        if (contains(gl_psnConversion_Results, 'R') > -1)    Permis = Permis | read
        if (contains(gl_psnConversion_Results, 'M') > -1)    Permis = Permis | modify
        if (contains(gl_psnConversion_Results, 'C') > -1)    Permis = Permis | create
        if (contains(gl_psnConversion_Results, 'D') > -1)    Permis = Permis | delete
        if (contains(gl_psnConversion_Results, 'A') > -1)    Permis = Permis | control
        return(Permis)
}     // end fPermisOf(string)

 

  • Louie